<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        .nav {
            height: 50px;
            background-color: #f00;
        }

        .nav li {
            float: left;
            width: 100px;
            text-align: center;
            line-height: 50px;
            position: relative;
        }

        .hide {
            width: 100px;
            height: 200px;
            background-color: #ff0;

            position: absolute;

            height: 0;
            overflow: hidden;
            transition: .3s;
        }

        .nav li:hover .hide {
            height: 200px;
        }


        .cart{
            float: right;
            width: 100px;
            text-align: center;
            line-height: 50px;
            position: relative;
        }

        .hide-cart {
            width: 200px;
            height: 100px;
            background-color: #ff0;

            position: absolute;
            right: 0;

            height: 0;
            overflow: hidden;
            transition: .3s;
        }

        .cart:hover .hide-cart {
            height: 100px;
        }
    </style>
</head>

<body>

    <div class="nav">
        <ul>
            <li>
                <a href="">首页</a>
                <div class="hide"></div>
            </li>
            <li>
                <a href="">首页</a>
                <div class="hide"></div>
            </li>
            <li>
                <a href="">首页</a>
                <div class="hide"></div>
            </li>
            <li>
                <a href="">首页</a>
                <div class="hide"></div>
            </li>
        </ul>
        <div class="cart">
            <a href="">购物车</a>
            <div class="hide-cart"></div>
        </div>
    </div>

</body>

</html>